package com.example.communitypro.mapper;

import com.example.communitypro.pojo.Notification;

import java.util.List;

public interface NotificationMapper {
    int deleteByPrimaryKey(Integer notificationId);

    int insert(Notification record);

    int insertSelective(Notification record);

    Notification selectByPrimaryKey(Integer notificationId);

    int updateByPrimaryKeySelective(Notification record);

    int updateByPrimaryKey(Notification record);

    /**
     * Gululo
     * @return
     */
    List<Notification> selectAll(); //查询全部

    /**
     *
     * @param userNo
     * @return 根据指定userNo查询出的通知
     */
    List<Notification> queryNotificationByUserNo(Integer userNo);

    /**
     * 修改用户的通知是否已读
     * @param notificationId
     * @return
     */
    int updateIsReadByUserNo(Integer notificationId,Integer isRead);

    /**
     *
     * @param type
     * @return 根据指定type查询出的通知
     */
    List<Notification> queryNotificationByType(Integer type);

    /**
     *
     * @param userNo
     * @return 根据指定userNo和查询出的通知
     */
    List<Notification> queryNotificationByuserNoAndPostNo(Integer userNo,Integer postNo);

}